package com.example.project.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.project.core.text.Convert;
import com.example.project.entity.IssuePrioritie;
import com.example.project.mapper.IssuePrioritieMapper;
import com.example.project.service.IssuePrioritieService;
import com.example.project.utils.CacheUtils;

/**
 * 问题优先级Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-28
 */
@Service
public class IssuePrioritieServiceImpl implements IssuePrioritieService {

	@Autowired
	private IssuePrioritieMapper issuePrioritieMapper;

	/**
	 * 查询问题优先级
	 * 
	 * @param id 问题优先级主键
	 * @return 问题优先级
	 */
	@Override
	public IssuePrioritie selectIssuePrioritieById(Long id) {
		return issuePrioritieMapper.selectIssuePrioritieById(id);
	}

	/**
	 * 查询问题优先级列表
	 * 
	 * @param tIssuePriorities 问题优先级
	 * @return 问题优先级
	 */
	@Override
	public List<IssuePrioritie> selectIssuePrioritieList(IssuePrioritie tIssuePriorities) {
		return issuePrioritieMapper.selectIssuePrioritieList(tIssuePriorities);
	}

	/**
	 * 新增问题优先级
	 * 
	 * @param tIssuePriorities 问题优先级
	 * @return 结果
	 */
	@Override
	public int insertIssuePrioritie(IssuePrioritie tIssuePriorities) {
		CacheUtils.remove("issuePrioritieList");
		return issuePrioritieMapper.insertIssuePrioritie(tIssuePriorities);
	}

	/**
	 * 修改问题优先级
	 * 
	 * @param tIssuePriorities 问题优先级
	 * @return 结果
	 */
	@Override
	public int updateIssuePrioritie(IssuePrioritie tIssuePriorities) {
		CacheUtils.remove("issuePrioritieList");
		return issuePrioritieMapper.updateIssuePrioritie(tIssuePriorities);
	}

	/**
	 * 批量删除问题优先级
	 * 
	 * @param ids 需要删除的问题优先级主键
	 * @return 结果
	 */
	@Override
	public int deleteIssuePrioritieByIds(String ids) {
		CacheUtils.remove("issuePrioritieList");
		return issuePrioritieMapper.deleteIssuePrioritieByIds(Convert.toStrArray(ids));
	}

	/**
	 * 删除问题优先级信息
	 * 
	 * @param id 问题优先级主键
	 * @return 结果
	 */
	@Override
	public int deleteIssuePrioritieById(Long id) {
		CacheUtils.remove("issuePrioritieList");
		return issuePrioritieMapper.deleteIssuePrioritieById(id);
	}

	@Override
	public List<IssuePrioritie> findAllList() {
		// TODO Auto-generated method stub
		return issuePrioritieMapper.findAllList();
	}
}
